﻿CREATE PROCEDURE [dbo].[sp_Get_RepeatReport]
	@Month int,
	@Year int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    SELECT ro.MdNumber, zi.Division, zi.Market, 
    zi.City, z.Zip, zi.AgentName, ro.Reason
	FROM [dbo].[RepeatOrderRemark] ro, [dbo].ZipInfo zi, dbo.Zips z
	where ro.ZipID = zi.ZipID and zi.ZipID = z.ZipID
	and ro.PeriodMonth = @Month and ro.PeriodYear = @Year
END
GO
